﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableEventValidation="false" CodeBehind="ManageUsers.aspx.cs" Inherits="Mortgage.Account.ManageUsers" %>

<%@ Register Src="~/UserControl/ctrPager.ascx" TagPrefix="custom" TagName="Pager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <title>Quan ly nguoi dung</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ajaxtoolkit:ConfirmButtonExtender ID="cbDelete" runat="server" TargetControlID="btnDelete"
        ConfirmText="Bạn có thực sự muốn xóa dữ liệu này?" />
    <div class="grid">
        <center>
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td>
                        <asp:GridView ID="grdUsers" runat="server" AutoGenerateColumns="False" BackColor="White"
                            PageSize="10" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" DataKeyNames="UserName"
                            CellPadding="3" OnSelectedIndexChanged="grdUsers_SelectedIndexChanged">
                            <EmptyDataTemplate>
                                <div class="noData">
                                    Chưa có người dùng!</div>
                            </EmptyDataTemplate>
                            <Columns>
                                <asp:CommandField ShowSelectButton="True" SelectImageUrl="~/Images/icon/select.gif"
                                    ButtonType="Image" />
                                <asp:BoundField DataField="UserName" HeaderText="User Name" ItemStyle-Width="100px"
                                    ReadOnly="True" SortExpression="UserName" />
                                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" ItemStyle-Width="100px" />
                                <asp:BoundField DataField="Comment" HeaderText="Comment" SortExpression="Comment"
                                    ItemStyle-Width="200px" />
                                <asp:CheckBoxField DataField="IsApproved" HeaderText="Approved" ReadOnly="True" SortExpression="IsApproved" />
                                <asp:BoundField DataField="CreationDate" HeaderText="Creation Date" ReadOnly="True"
                                    SortExpression="CreationDate" />
                                <asp:BoundField DataField="LastLoginDate" HeaderText="Last Login Date" SortExpression="LastLoginDate" />
                                <asp:CheckBoxField DataField="IsOnline" HeaderText="Is Online" ReadOnly="True" SortExpression="IsOnline" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" />
                            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
                            <RowStyle ForeColor="#000066" />
                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td>
                        <custom:Pager ID="custPager" runat="server" OnPageChanged="custPager_PageChanged" />
                    </td>
                </tr>
            </table>
        </center>
    </div>
    <div class="detail">
        <div class="header">
            Thông tin tài khỏan</div>
        <asp:Label ID="DialogMess" runat="server" CssClass="failureNotification" />
        <table>
            <tr>
                <td class="label">
                    Tên đăng nhập:<span class="required">*</span>
                </td>
                <td>
                    <asp:TextBox ID="fldUserName" runat="server" Enabled="false" />
                    <asp:RequiredFieldValidator ID="reqfldUserName" runat="server" ErrorMessage="*" ValidationGroup="detail"
                        CssClass="failureNotification" ControlToValidate="fldUserName" />
                </td>
                <td class="label">
                    Role (Nhóm):
                </td>
                <td rowspan="5">
                    <asp:CheckBoxList ID="lstRole" runat="server">
                    </asp:CheckBoxList>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Mât khẩu:<span class="required">*</span>
                </td>
                <td>
                    <asp:TextBox ID="fldPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="reqfldPassword" runat="server" ErrorMessage="*" ValidationGroup="detail"
                        CssClass="failureNotification" ControlToValidate="fldPassword" />
                </td>
            </tr>
            <tr>
                <td class="label">
                    Mât khẩu xác nhận:<span class="required">*</span>
                </td>
                <td>
                    <asp:TextBox ID="fldConfirmPassword" runat="server" TextMode="Password" />
                    <asp:CompareValidator ID="reqfldConfirmPassword" runat="server" ValidationGroup="detail"
                        ErrorMessage="Mật khẩu không khớp." CssClass="failureNotification" ControlToValidate="fldConfirmPassword"
                        ControlToCompare="fldPassword" />
                </td>
            </tr>
            <tr>
                <td class="label">
                    Emai:
                </td>
                <td>
                    <asp:TextBox ID="fldEmail" runat="server" />
                    <asp:RegularExpressionValidator ValidationExpression="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
                        CssClass="failureNotification" ID="rxpEmail" runat="server" ErrorMessage="Email Address is not valid"
                        Text="Email không hợp lệ" ValidationGroup="detail" Display="Static" ControlToValidate="fldEmail"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Active
                </td>
                <td>
                    <asp:CheckBox ID="fldIsApproved" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="label">
                    Chú thích
                </td>
                <td>
                    <asp:TextBox ID="fldComment" runat="server" TextMode="MultiLine" Height="39px" Width="476px" />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="btnDelete" runat="server" Text="Xóa" CssClass="btnDelete" CausesValidation="false"
                        OnClick="btnDelete_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnNew" runat="server" Text="Tạo mới" CssClass="btnNew" CausesValidation="false"
                        OnClick="btnNew_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnSave" runat="server" Text="Lưu" CssClass="btnSave" ValidationGroup="detail"
                        OnClick="btnSave_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnCancel" runat="server" Text="Huy" CssClass="btnCancel" CausesValidation="false"
                        OnClick="btnCancel_Click" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
